﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using DAO;
using DTO;
using System.Windows.Forms;

namespace BaiTap1
{
    public partial class frm_main : Form
    {
        NguoiDung_DTO _nguoi_dung;
        public frm_main()
        {
            InitializeComponent();
        }
        public void Init(NguoiDung_DTO nd)
        {
            _nguoi_dung = nd;
            PhanQuyen(nd);
        }
        public void PhanQuyen(NguoiDung_DTO nd)
        {
            // quan ly
            // kho
            // thu ngan
            // other
        }
        private void btThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btNguoiDung_Click(object sender, EventArgs e)
        {
            frm_QLNguoiDung f = new frm_QLNguoiDung();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void btNhanVien_Click(object sender, EventArgs e)
        {
            frm_QLNhanVien f = new frm_QLNhanVien();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void btKhachHang_Click(object sender, EventArgs e)
        {
            frm_QLKhachHang f = new frm_QLKhachHang();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void btXuatKho_Click(object sender, EventArgs e)
        {
            frm_LapPhieuXuat f = new frm_LapPhieuXuat();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void btNhapKho_Click(object sender, EventArgs e)
        {
            frm_LapPhieuNhap f = new frm_LapPhieuNhap();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void btNguyenLieu_Click(object sender, EventArgs e)
        {
            frm_QLNguyenLieu f = new frm_QLNguyenLieu();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void btThanhToan_Click(object sender, EventArgs e)
        {
            frm_LapPhieuThu f = new frm_LapPhieuThu();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void mậtKhẩuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frm_DoiMatKhau f = new frm_DoiMatKhau();
            f.Init(_nguoi_dung._Ten_Dang_Nhap);
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void btChamCong_Click(object sender, EventArgs e)
        {
            frm_ChamCong f = new frm_ChamCong();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void thôngTinToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frm_ThongTin f = new frm_ThongTin();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void btHoaDon_Click(object sender, EventArgs e)
        {
            frm_LapHoaDon f = new frm_LapHoaDon();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void btDatBan_Click(object sender, EventArgs e)
        {
            frm_DanhSachDatBan f = new frm_DanhSachDatBan();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            frm_NhaCungCap f = new frm_NhaCungCap();
            f.ShowDialog();
            f.ShowInTaskbar = false;
        }
    }
}
